package temp;

import algorithms.sort.Heap;

import java.util.Arrays;

/**
 * @description:
 * @author: zk
 * @date: 2024-02-02
 */
public class HeapTest {
    public static void main(String[] args) {
        //baseHeapTest();
        heapSort();
    }

    private static void baseHeapTest() {
        Heap heap = new Heap(10);
        heap.insert(7);
        heap.insert(8);
        heap.insert(1);
        heap.insert(3);
        heap.insert(4);
        heap.insert(6);
        heap.insert(5);
        heap.insert(2);

        int heapSize = heap.getHeapSize();
        for (int i = 0; i < heapSize; i++) {
            System.out.println(heap.remove());
        }
    }

    private static void heapSort() {
        int[] arr = {7,8,1,3,4,6,5,2};
        int[] sort = Heap.sort(arr);
        System.out.println(Arrays.toString(sort));
    }
}
